package com.halflife.comeElectricity.orderMng.history;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

@Repository
public interface HistoryOrderRepository {
    int deleteByPrimaryKey(Integer id);

    int insert(HistoryOrder record);

    int insertSelective(HistoryOrder record);

    HistoryOrder selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(HistoryOrder record);

    int updateByPrimaryKey(HistoryOrder record);
    BigDecimal getMyMoney(@Param("riderId") Integer riderId, @Param("status") Byte status);

    /**
     * 查询所有订单页面
     * @param record
     * @return
     */
    List<HistoryOrder> selectHistoryOrderByPage(HashMap<String, Object> param);

    /**
     *  查询订单数量
     * @param record
     * @return
     */
    int selectHistoryCountOrderByPage(HashMap<String, Object> param);
    /**
     *  查询骑手金额
     * @param record
     * @return
     */
    BigDecimal selectRiderAccountOrderByPage(HashMap<String, Object> param);
    /**
     *  查询骑手金额
     * @param record
     * @return
     */
    BigDecimal selectOrderAccountSumByIds(HashMap<String, Object> param);
    /**
     *  更新订单状态并且生成付款记录
     * @param record
     * @return
     */
    int updateOrderStatus(HashMap<String, Object> param);

}